package com.haoshuang.zhouzhoubang.ui.page.welfare.free

import com.haoshuang.zhouzhoubang.databinding.ItemFreeOrderWelfareBinding
import com.haoshuang.zhouzhoubang.model.bean.FreeOrderWelfareBean
import com.mufeng.libs.base.BaseBindingHolder
import com.mufeng.libs.base.BaseBindingQuickAdapter


/**
 * 
 */
class FreeOrderWelfareAdapter(data: MutableList<FreeOrderWelfareBean>) : BaseBindingQuickAdapter<FreeOrderWelfareBean, ItemFreeOrderWelfareBinding>(data) {

    override fun onBindViewHolder(holder: BaseBindingHolder, position: Int, item: FreeOrderWelfareBean?) {
        holder.getViewBinding<ItemFreeOrderWelfareBinding>().apply {

            if (item == null) return@apply
            if (item.suk_unique.isNullOrEmpty()){
                tvName.text = "${item?.cate_name}"
            }else{
                tvName.text = "${item?.cate_name}【${item?.suk_unique}】"
            }
            tvTime.text = "${item.add_time}"
            tvValue.text = "${item.number}"

        }
    }

}